div.videoblock(id=node.$id(),class=[node.$style(), node.$role()])
  if node['$title?']()
    .title node.$captioned_title()
  .content
    case node.$attr('poster')
      when "vimeo"
        - start_anchor = node['$attr?']('start') ? "#at=" + node.$attr("start") : ''
        - delimeter = "?"
        - autoplay_param = node['$option?']('autoplay') ? delimeter + "autoplay=1" : ''
        - delimeter = node['$option?']('autoplay')  ? '&' : ''
        - loop_param = node['$option?']('loop') ? delimeter + "loop=1" : ''
        - src = "//player.vimeo.com/video/" + node.$attr('target') + start_anchor + autoplay_param + loop_param
        iframe(width=node.$attr('width'),height=node.$attr('height'),src=src,frameborder=0,webkitAllowFullScreen=true,mozallowfullscreen=true,allowFullScreen=true)
      when "youtube"
        - amp = '&'
        - params = ['rel=0']
        - params.push(node.$attr('start', false) ? (amp + "start=" + node.$attr('start')) : "")
        - params.push(node.$attr('end', false) ? (amp + "end=" + node.$attr('end')) : "")
        - params.push(node['$option?']('autoplay') ? amp + "autoplay=1" :  "")
        - params.push(node['$option?']('loop') ? (amp + "loop=1") :  "")
        - params.push(node['$option?']('nocontrols') ? (amp + "controls=0") :  "")
        - src = "//www.youtube.com/embed/" + node.$attr('target') + "/?" + params.join('')
        iframe(width=node.$attr('width'),height=node.$attr('height'),src=src,frameborder=0,allowfullscreen=!node['$option?']('nofullscreen'))
      default
        video(src=node.$media_uri(node.$attr('target')),width=node.$attr('width'),height=node.$attr('height'),
        poster=node.$attr('poster', false) ? node.$media_uri(node.$attr('poster')) : '',
        autoplay=node['$option?']('autoplay'),controls=!node['$option?']('nocontrols'),
        loop=node['$option?']('loop'))
          | Your browser does not support the video tag.

